<script>
  import $ from 'dfish-widget'
  import Method from '../Method.vue'

  export default {
    mixins: [Method],
    data() {
      return {
        name: '$.numFormat(num, [length], [separator], [rightward])',
        remark: '格式化数字。',
        attrs: [{
          name: 'num',
          remark: '数字',
          type: 'String',
        },{
          name: 'length',
          remark: '分隔长度。默认值为 3',
          type: 'Number',
        },{
          name: 'separator',
          remark: '分隔符。默认值为 ","',
          type: 'String',
        },{
          name: 'rightward',
          remark: '是否从左向右的方向来分隔',
          type: 'Boolean'
        }],
        examples: [{
          remark: '范例',
          code: `
            let n = $.numFormat(1234); // 返回 "1,234"
            `
        }]
      }
    }
  }
</script>
